from IPython.display import display, Markdown
def latexify(x):
out = '$' + x + '$'
return out
def lprint(x):
display(Markdown(latexify(latex(x))))
Now we will formulate a harder multidimensional example and try to find it's bifurcation points
Lets make a more complicated multivariable function to try to apply bifurcation theory to
We aim to get a spiral bifurcation: use this equation https://www.desmos.com/calculator/di2adchd7a,
Derived by unpacking the tan definition for the Archimedian spiral
var('x y')
var('l', latex_name=r'\lambda')
f = (x^2 + y^2)*(x*sin(sqrt(x^2 + y^2 + 1)) - y*cos(sqrt(x^2 + y^2 + 1)) + 5*sin(l)) # +1s in sqrt to make it smooth
lprint(f)
Essentially the solution set at for any fixed $\lambda$ is an "offset spiral", when $\lambda = \pi k$ we have a spiral that passes through the origin, we intend for these to become bifurcation points, we add a factor fo $x^2 + y^2$ to introduce the trivial zeros.
implicit_plot3d(f, (-5, 5), (-5,5), (-5,5), opacity = 0.75) + plot3d(0 , (-5, 5), (-0.1,0.1), color = 'black')
But now we see a problem, as a $f: \mathbb{R}^3 \rightarrow \mathbb{R}$, we expect the zero set to be locally a 2-dimensional manifold, by the implicit function theorem.
Technically, viewing $f$ as $f: \mathbb{R}^2 \times \mathbb{R} \rightarrow \mathbb{R}$, provided that $Df_{k} : \mathbb{R} \rightarrow \mathbb{R}$ is an isomorphism then local the zero set can be paramaterised by the other two variables, inducing a manifold.
Here the choice of variable $k$ is deliberately vague, since we can assume it to be either $x$, $y$ or $\lambda$. So we can reason that the zero set is locally a 2-manifold unless $\partial_{x}, \partial_{y}, \partial{\lambda}$ are all zero, hence the linear map style derivative is not an isomorphism $\mathbb{R} \rightarrow \mathbb{R}$
We will be interested in points where $\lambda = \pi k$, and so $\partial_{\lambda} f = -5 \cos(\lambda) = \pm 1$, so already we have that the solution set is locally a 2-manifold.
This means that our local bifurcation theory is invalid, since we look for solutions that bifurcate out as single dimensional manifolds
We see that this is not a quality specific to the choice of function $f$, but rather a symption of the dimensionality of our system. One equation in three unknowns will usually lead to a "two dimensional" set of solutions.
In fact there is another unavoidable reason we cannot apply the bifurcation theory set up in bt_global. To see why we need to consider Fredholm indices.
Denoting $X = \mathbb{R}^2$, we see that
$$f : \mathbb{R} \times X \rightarrow Y (=\mathbb{R})$$and
$$ L = \partial_{x}F \in \mathcal{L}(X,Y)$$i.e,
$$ L \in \mathcal{L}(\mathbb{R}^2, \mathbb{R}) $$Computing the Fredholm index of $\mathcal{L}$
Casewise this is:
$$\text{ind} \mathcal{L} = 2 - 1 = 1 $$$$\text{ind} \mathcal{L} = 1 - 0 = 1 $$We can't have a zero dimensional kernel by the Rank-Nullity theorem
Either way, $\mathcal{L}$ does not have Fredholm index zero, and as such all of our theory is invalid. Luckily there is an easy fix: decrease the Fredholm index, i.e increase the dimension of the codomain, i.e add another equation
g = x*sin(sqrt(x^2 + y^2 + 1)) - y*cos(sqrt(x^2 + y^2 + 1))
lprint(g)
implicit_plot3d(g, (-5, 5), (-5,5), (-5,5), opacity = 0.75) b
Here the black line should be running parallel to the curve, removing the dependency on $\lambda$ means that this zero set will intersect the other at an angle
implicit_plot3d(f, (-5, 5), (-5,5), (-5,5), opacity = 0.75) + implicit_plot3d(g, (-5, 5), (-5,5), (-5,5), opacity = 0.75, color = 'red') + plot3d(0 , (-1, 1), (-0.01,0.01), color = 'black')